﻿@section header{

}
<form id="form1">
    <div class="form-layout">
        <table class="form">
            <tr>
                <th class="formTitle">上级</th>
                <td class="formValue">
                    <select id="ParentId" name="ParentId" class="form-control">
                        <option value="0">父节点</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">名称</th>
                <td class="formValue">
                    <input id="FullName" name="FullName" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">编号</th>
                <td class="formValue">
                    <input id="EnCode" name="EnCode" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">排序</th>
                <td class="formValue">
                    <input id="SortCode" name="SortCode" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle" style="height: 35px;">选项</th>
                <td class="formValue" style="padding-top: 1px;">
                    <div class="ckbox">
                        <input id="EnabledMark" name="EnabledMark" type="checkbox" checked="checked"><label for="EnabledMark">有效</label>
                    </div>
                </td>
            </tr>
            <tr>
                <th class="formTitle" valign="top" style="padding-top: 5px;">
                    备注
                </th>
                <td class="formValue">
                    <textarea id="Description" name="Description" class="form-control" style="height: 60px;"></textarea>
                </td>
            </tr>
            <tr>
                <th class="formTitle">创建人员</th>
                <td class="formValue">
                    <input id="CreatorUserId" name="CreatorUserId" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">创建时间</th>
                <td class="formValue">
                    <input id="CreatorTime" name="CreatorTime" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">修改人员</th>
                <td class="formValue">
                    <input id="LastModifyUserId" name="LastModifyUserId" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">修改时间</th>
                <td class="formValue">
                    <input id="LastModifyTime" name="LastModifyTime" type="text" class="form-control" />
                </td>
            </tr>
        </table>
    </div>
</form>
@section scripts{
    <script>
        var keyValue = $.request("keyValue");
        $(function () {
            $("#ParentId").bindSelect({
                url: "/rbac/ItemsType/GetTreeSelectJson"
            });
            if (!!keyValue) {
                $.ajax({
                    url: "/rbac/ItemsType/GetFormJson",
                    data: { keyValue: keyValue },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        $("#form1").formSerialize(data);
                        $("#form1").find('.form-control,select,input').attr('readonly', 'readonly');
                        $("#form1").find('div.ckbox label').attr('for', '');
                    }
                });
            }
        });
    </script>
}